﻿#ifndef __TES_LINESPACE_H__
#define __TES_LINESPACE_H__

//线性插值
template<typename T>
class TesLinespace
{
    T min;              ///< 线性空间的最小值
    T max;              ///< 线性空间的最大值
    double length;      ///< 线性空间的长度

public:

    TesLinespace(){}

    TesLinespace(T min, T max, double length)
    {
        this->min = min;
        this->max = max;
        this->length = length;
    }

    T GetValue(double leng)
    {
        double ratio = leng / length;
        T space = max - min;
        return (T)(min + space * ratio);
    }
};

#endif